<?php

namespace app\cps\controller;

use think\facade\Request;
use app\common\Common;
use app\common\StsService;

class Upload extends Base
{
    /**
     * 图片直传凭证
     * 
     * @date 2022/08/11
     * @return json
     */
    public function uploadCredentials()
    {
        $object = new StsService();
        $data = $object->getStsAuth();

        if ($data['statusCode'] != 200) {
            return Common::fail($data['errorMessage']);
        }

        return Common::success($data);
    }
}